#ifndef CINITSOCK_H
#define CINITSOCK_H

#include <winsock2.h>

#pragma comment(lib, "ws2_32.lib");

class CInitSock
{
public:
	CInitSock(BYTE minorVer = 2, BYTE majorVer = 2)
	{
		WSADATA wsaData;
		WORD sockVersion = MAKEWORD(minorVer, majorVer);
		if(WSAStartup(sockVersion, &wsaData))
			exit(0);
	}
	~CInitSock()
	{
		WSACleanup();
	}
};

#endif